package cn.wen.yinxiu.system.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import cn.wen.yinxiu.common.convention.result.Results;
import cn.wen.yinxiu.system.vo.ActivityListVO;
import cn.wen.yinxiu.system.vo.ActivityMonthVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import cn.wen.yinxiu.system.entity.ActivityEntity;
import cn.wen.yinxiu.system.service.ActivityService;
import cn.wen.yinxiu.common.toolkit.PageUtils;
import cn.wen.yinxiu.common.convention.result.ResultEntity;

/**
 *
 * @ClassName: ActivityController
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-22 09:46:50
 * @Description: 的Controller层
 */
@RestController
@RequestMapping("/web")
public class ActivityController {

    @Autowired
    private ActivityService activityService;

    /**
     * 获取每个月的活动列表
     * 请求参数格式 year-month  "2023-5"
     * @return
     */
    @GetMapping("/api/system/activity/list")
    public ResultEntity<List<ActivityMonthVO>> getActivityList(@RequestParam("yearMonth") String yearMonth) {
        List<ActivityMonthVO> res = activityService.getActivityList(yearMonth);
        return Results.success(res);
    }


}
